Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 vector-feature-night-mode-enabled skin-theme-clientpref-os vector-sticky-header-enabled" lang="fr" dir="ltr"><head>
<meta charset="UTF-8">
<title>Bcrypt</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="./_res_/favicon.png">
<link rel="canonical" href="https://fr.wikipedia.org/wiki/Bcrypt"> <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
<link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
<link rel="stylesheet" type="text/css" href="./_res_/footer.css">
<link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Bcrypt rootpage-Bcrypt skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Bcrypt</span></h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="contentSub">
<div id="mw-content-subtitle"></div>
</div>
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="fr" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="fr" dir="ltr"><div class="infobox_v3 infobox infobox--frwiki noarchive large"><div class="entete" style="background-color:#E1E1E1;color:#000000"><div>Bcrypt</div></div><table><caption style="color:#000000;text-align:center;background-color:#E1E1E1">Présentation</caption><tbody><tr class=""><th scope="row">Type</th><td class=""><div>
<span class="wd_p31"><a href="Fonction_de_d%C3%A9rivation_de_cl%C3%A9" title="Fonction de dérivation de clé">Fonction de dérivation de clé</a></span></div></td></tr><tr class=""><th scope="row">Créateur</th><td class=""><div>
<span class="wd_p170">Niels Provos <small>(<a href="https://en.wikipedia.org/wiki/Niels_Provos" class="extiw external" title="en:Niels Provos"><span class="indicateur-langue" title="Article sur Wikipédia en anglais">en</span></a>)</small></span></div></td></tr></tbody></table></div>
<p><b>Bcrypt</b> est une <a href="Fonction_de_d%C3%A9rivation_de_cl%C3%A9" title="Fonction de dérivation de clé">fonction de dérivation de clé</a> créée par Niels Provos et David Mazières. Elle est basée sur l'<a href="Algorithme" title="Algorithme">algorithme</a> de <a href="Chiffrement" title="Chiffrement">chiffrement</a> <a href="Blowfish" title="Blowfish">Blowfish</a> et a été présentée lors de <a href="USENIX" class="mw-redirect" title="USENIX">USENIX</a> en <a href="1999_en_informatique" title="1999 en informatique">1999</a><sup id="cite_ref-provos_1-0" class="reference"><a href="#cite_note-provos-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>. En plus de l'utilisation d'un <a href="Salage_(cryptographie)" title="Salage (cryptographie)">sel</a> pour se protéger des attaques par <a href="Table_arc-en-ciel" class="mw-redirect" title="Table arc-en-ciel">table arc-en-ciel</a> (<i><span class="lang-en" lang="en">rainbow table</span></i>), bcrypt est une fonction adaptative, c'est-à-dire que l'on peut augmenter le nombre d'<a href="It%C3%A9ration" title="Itération">itérations</a> pour la rendre plus lente. Ainsi elle continue à être résistante aux <a href="Attaque_par_force_brute" title="Attaque par force brute">attaques par force brute</a> malgré l'augmentation de la <a href="FLOPS" title="FLOPS">puissance de calcul</a>.
</p><p>Blowfish est un algorithme de <a href="Chiffrement_par_bloc" title="Chiffrement par bloc">chiffrement par bloc</a> notable pour sa phase d'établissement de <a href="Cl%C3%A9#Informatique_ou_cryptographie" class="mw-disambig" title="Clé">clef</a> relativement coûteuse. Bcrypt utilise cette propriété et va plus loin. Provos et Mazières ont conçu un nouvel algorithme d'établissement des clefs nommé Eksblowfish (pour <span class="lang-en" lang="en"><i>Expensive Key Schedule Blowfish</i></span>). Dans cet algorithme, une première phase consiste à créer les sous-clefs grâce à la clef et au sel. Ensuite un certain nombre de tours de l'algorithme standard blowfish sont appliqués avec alternativement le sel et la clef. Chaque tour commence avec l'état des sous-clefs du tour précédent. Cela ne rend pas l'algorithme plus puissant que la version standard de blowfish, mais on peut choisir le nombre d'itérations ce qui le rend arbitrairement lent et contribue à dissuader les attaques par <a href="Table_arc-en-ciel" class="mw-redirect" title="Table arc-en-ciel">table arc-en-ciel</a> et par force brute.
</p><p>Bcrypt permet aussi de chiffrer des informations, bien que cette fonction soit moins utilisée en <a href="D%C3%A9veloppement_de_logiciel" title="Développement de logiciel">développement informatique</a>. D'ailleurs le nom Bcrypt est souvent à l'origine de confusion chez les apprentis développeurs qui utilisent indifféremment les mots hachage et chiffrement. Ce sont deux notions qui n'ont rien à voir, la hachage est à sens unique, alors que le chiffrement peut être inversé avec le déchiffrement, grâce au système de <a href="Cryptographie_asym%C3%A9trique" title="Cryptographie asymétrique">clé publique-clé privée</a><sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>.
</p><p>Le nombre d'itérations doit être une <a href="Puissance_de_deux" title="Puissance de deux">puissance de deux</a>, c'est un paramètre de l'algorithme et ce nombre est codé dans le résultat final.
</p><p>Après la première implémentation dans <a href="OpenBSD" title="OpenBSD">OpenBSD</a>, cet algorithme s'est généralisé et est maintenant disponible dans un grand nombre de langages (<a href="C_(langage)" title="C (langage)">C</a>, <a href="C%2B%2B" title="C++">C++</a>, <a href="C_Sharp" title="C Sharp">C#</a>, <a href="Delphi_(langage)" title="Delphi (langage)">Delphi</a>, <a href="Elixir_(langage)" title="Elixir (langage)">Elixir</a>, <a href="Go_(langage)" title="Go (langage)">Go</a>, <a href="JavaScript" title="JavaScript">JavaScript</a>, <a href="Java_(langage)" title="Java (langage)">Java</a>, <a href="Python_(langage)" title="Python (langage)">Python</a>, <a href="Ruby" title="Ruby">Ruby</a>, <a href="Perl_(langage)" title="Perl (langage)">Perl</a>, <a href="PHP" title="PHP">PHP 5.3+</a>,&nbsp;<abbr class="abbr" title="et cetera">etc.</abbr>).
</p>

<div class="mw-heading mw-heading2"><h2 id="Algorithme">Algorithme</h2></div>
<p>L'algorithme dépend fortement de l'établissement des clefs de la méthode «&nbsp;Eksblowfish&nbsp;»&nbsp;:
</p>
<pre>EksBlowfishSetup(<i>cost</i>, <i>salt</i>, <i>key</i>)
<i>state</i> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \gets }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">←<!-- ← --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \gets }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1c2dd7a1d3a3f2df940296f2485c2e10355b16f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.324ex; height:1.843ex;" alt="{\displaystyle \gets }" loading="lazy"></span> InitState()
<i>state</i> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \gets }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">←<!-- ← --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \gets }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1c2dd7a1d3a3f2df940296f2485c2e10355b16f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.324ex; height:1.843ex;" alt="{\displaystyle \gets }" loading="lazy"></span> ExpandKey(<i>state</i>, <i>salt</i>, <i>key</i>)
<b>repeat</b> (2<sup><i>cost</i></sup>)
<i>state</i> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \gets }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">←<!-- ← --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \gets }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1c2dd7a1d3a3f2df940296f2485c2e10355b16f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.324ex; height:1.843ex;" alt="{\displaystyle \gets }" loading="lazy"></span> ExpandKey(<i>state</i>, 0, <i>key</i>)
<i>state</i> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \gets }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">←<!-- ← --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \gets }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1c2dd7a1d3a3f2df940296f2485c2e10355b16f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.324ex; height:1.843ex;" alt="{\displaystyle \gets }" loading="lazy"></span> ExpandKey(<i>state</i>, 0, <i>salt</i>)
<b>return</b> <i>state</i>
</pre>
<p>Cette méthode prend trois paramètres&nbsp;:
</p>
<ul><li><code>cost</code>&nbsp;: le coût souhaité de l'algorithme. C'est le <a href="Logarithme_binaire" title="Logarithme binaire">logarithme binaire</a> du nombre d'itérations choisi&nbsp;;</li>
<li><code>salt</code>&nbsp;: sel utilisé par l'algorithme&nbsp;;</li>
<li><code>key</code>&nbsp;: le mot de passe que l'on souhaite hacher.</li></ul>
<p><code>InitState</code> fonctionne de la même manière que dans l'algorithme Blowfish original, le P-array et le S-bow sont initialisés avec la partie décimale de <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \pi }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>π<!-- π --></mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \pi }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/9be4ba0bb8df3af72e90a0535fabcc17431e540a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.332ex; height:1.676ex;" alt="{\displaystyle \pi }" loading="lazy"></span> en hexadécimal.
</p><p>La fonction <code>ExpandKey</code> peut se décrire ainsi&nbsp;:
</p>
<pre>ExpandKey(<i>state</i>, <i>salt</i>, <i>key</i>)
for(<i>n</i> = 1..18)
P<sub>n</sub> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \gets }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">←<!-- ← --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \gets }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1c2dd7a1d3a3f2df940296f2485c2e10355b16f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.324ex; height:1.843ex;" alt="{\displaystyle \gets }" loading="lazy"></span> <i>key</i>[32(n-1)..32n-1] <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \oplus }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo>⊕<!-- ⊕ --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \oplus }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/8b16e2bdaefee9eed86d866e6eba3ac47c710f60.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:1.808ex; height:2.176ex;" alt="{\displaystyle \oplus }" loading="lazy"></span> P<sub>n</sub> //treat the key as cyclic
<i>ctext</i> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \gets }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">←<!-- ← --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \gets }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1c2dd7a1d3a3f2df940296f2485c2e10355b16f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.324ex; height:1.843ex;" alt="{\displaystyle \gets }" loading="lazy"></span> Encrypt(<i>salt</i>[0..63])
P<sub>1</sub> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \gets }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">←<!-- ← --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \gets }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1c2dd7a1d3a3f2df940296f2485c2e10355b16f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.324ex; height:1.843ex;" alt="{\displaystyle \gets }" loading="lazy"></span> <i>ctext</i>[0..31]
P<sub>2</sub> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \gets }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">←<!-- ← --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \gets }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1c2dd7a1d3a3f2df940296f2485c2e10355b16f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.324ex; height:1.843ex;" alt="{\displaystyle \gets }" loading="lazy"></span> <i>ctext</i>[32..63]
for(<i>n</i> = 2..9)
<i>ctext</i> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \gets }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">←<!-- ← --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \gets }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1c2dd7a1d3a3f2df940296f2485c2e10355b16f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.324ex; height:1.843ex;" alt="{\displaystyle \gets }" loading="lazy"></span> Encrypt(<i>ctext</i> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \oplus }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo>⊕<!-- ⊕ --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \oplus }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/8b16e2bdaefee9eed86d866e6eba3ac47c710f60.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:1.808ex; height:2.176ex;" alt="{\displaystyle \oplus }" loading="lazy"></span> <i>salt</i>[64(n-1)..64n-1]) // Encrypt utilise la clef actuelle et le sel sous forme cyclique
P<sub>2n-1)</sub> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \gets }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">←<!-- ← --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \gets }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1c2dd7a1d3a3f2df940296f2485c2e10355b16f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.324ex; height:1.843ex;" alt="{\displaystyle \gets }" loading="lazy"></span> <i>ctext</i>[0..31]
P<sub>2n</sub> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \gets }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">←<!-- ← --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \gets }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1c2dd7a1d3a3f2df940296f2485c2e10355b16f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.324ex; height:1.843ex;" alt="{\displaystyle \gets }" loading="lazy"></span> <i>ctext</i>[32..63]
for(<i>i</i> = 1..4)
for(<i>n</i> = 0..127)
<i>ctext</i> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \gets }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">←<!-- ← --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \gets }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1c2dd7a1d3a3f2df940296f2485c2e10355b16f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.324ex; height:1.843ex;" alt="{\displaystyle \gets }" loading="lazy"></span> Encrypt(<i>ctext</i> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \oplus }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo>⊕<!-- ⊕ --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \oplus }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/8b16e2bdaefee9eed86d866e6eba3ac47c710f60.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:1.808ex; height:2.176ex;" alt="{\displaystyle \oplus }" loading="lazy"></span> <i>salt</i>[64(n-1)..64n-1]) // comme au-dessus
S<sub>i</sub>[2n] <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \gets }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">←<!-- ← --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \gets }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1c2dd7a1d3a3f2df940296f2485c2e10355b16f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.324ex; height:1.843ex;" alt="{\displaystyle \gets }" loading="lazy"></span> <i>ctext</i>[0..31]
S<sub>i</sub>[2n+1] <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \gets }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">←<!-- ← --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \gets }</annotation>
</semantics>
</math></span><img src="./_assets_/eb734a37dd21ce173a46342d1cc64c92/1c2dd7a1d3a3f2df940296f2485c2e10355b16f9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.324ex; height:1.843ex;" alt="{\displaystyle \gets }" loading="lazy"></span> <i>ctext</i>[32..63]
<b>return</b> <i>state</i>
</pre>
<div class="mw-heading mw-heading2"><h2 id="Notes_et_références"><span id="Notes_et_r.C3.A9f.C3.A9rences"></span>Notes et références</h2></div>
<div class="references-small decimal" style=""><div class="mw-references-wrap"><ol class="references">
<li id="cite_note-provos-1"><span class="mw-cite-backlink"><a href="#cite_ref-provos_1-0">↑</a> </span><span class="reference-text"><span class="ouvrage" id="ProvosDavid1999"><span class="ouvrage" id="Niels_ProvosMazières,_David1999">Niels <span class="nom_auteur">Provos</span> et Mazières, David, «&nbsp;<cite style="font-style:normal">A Future-Adaptable Password Scheme</cite>&nbsp;», <i>Proceedings of 1999 USENIX Annual Technical Conference</i>,‎ <time>1999</time>, <abbr class="abbr" title="pages">p.</abbr>&nbsp;<span class="nowrap">81–92</span> <small style="line-height:1em;">(<a rel="nofollow" class="external text" href="http://www.usenix.org/events/usenix99/provos/provos_html/node1.html">lire en ligne</a>)</small><span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.atitle=A+Future-Adaptable+Password+Scheme&amp;rft.jtitle=Proceedings+of+1999+USENIX+Annual+Technical+Conference&amp;rft.aulast=Provos&amp;rft.aufirst=Niels&amp;rft.au=Mazi%C3%A8res%2C+David&amp;rft.date=1999&amp;rft.pages=81%E2%80%9392&amp;rft_id=http%3A%2F%2Fwww.usenix.org%2Fevents%2Fusenix99%2Fprovos%2Fprovos_html%2Fnode1.html&amp;rfr_id=info%3Asid%2Ffr.wikipedia.org%3ABcrypt"></span></span></span></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a> </span><span class="reference-text"><span class="ouvrage" id="Stephane2023"><span class="nom_auteur">Stephane</span>, «&nbsp;<a rel="nofollow" class="external text" href="https://www.ideeclis.fr/5238.html"><cite style="font-style:normal;">Différence entre le cryptage et le hachage - Les Idées Clis</cite></a>&nbsp;», sur <span class="italique">IdeeClis</span>, <time class="nowrap" datetime="2023-05-05" data-sort-value="2023-05-05">5 mai 2023</time> <small style="line-height:1em;">(consulté le <time class="nowrap" datetime="2023-08-21" data-sort-value="2023-08-21">21 août 2023</time>)</small></span></span>
</li>
</ol></div>
</div>
<div class="mw-heading mw-heading2"><h2 id="Annexes">Annexes</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Liens_externes">Liens externes</h3></div>
<ul><li><a rel="nofollow" class="external text" href="http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/crypt/bcrypt.c">Implémentation d'OpenBSD en C</a></li>
<li><a rel="nofollow" class="external text" href="http://www.bcrypt.fr">Calculatrice bcrypt en ligne</a></li>
<li><a rel="nofollow" class="external text" href="http://openwall.com/crypt/">Implementation en C d'Openwall</a></li>
<li><a rel="nofollow" class="external text" href="http://www.jayfuerstenberg.com/blog/bcrypt-in-objective-c">JFBCrypt - implementation de bcrypt en Objective C</a></li>
<li><a rel="nofollow" class="external text" href="http://bcrypt.codeplex.com/">BCrypt.Net</a> Implémentation en C# pour .NET</li>
<li><a rel="nofollow" class="external text" href="https://code.google.com/p/jbcrypt/">jBCrypt</a> - Implémentation de bcrypt en Java par Damien Miller</li>
<li><a rel="nofollow" class="external text" href="https://pkg.go.dev/golang.org/x/crypto/bcrypt">bcrypt.go - implementation en Go</a></li>
<li><a rel="nofollow" class="external text" href="https://github.com/ncb000gt/node.bcrypt.js/">node.bcrypt.js</a> - API bcrypt pour node.js autour de la version C OpenBSD</li>
<li><a rel="nofollow" class="external text" href="https://github.com/fpirsch/twin-bcrypt">twin-bcrypt</a> - Implémentation en javascript+asm.js pour Node.js et navigateurs basée sur jBCrypt</li>
<li><a rel="nofollow" class="external text" href="https://github.com/Erly/dbcrypt">dBCrypt</a> - Implémentation en Dart basée sur jBCrypt</li>
<li><a rel="nofollow" class="external text" href="https://rubygems.org/gems/bcrypt-ruby">bcrypt-ruby</a> - Implémentation en Ruby</li>
<li><a rel="nofollow" class="external text" href="https://metacpan.org/module/Crypt::Eksblowfish::Bcrypt">Crypt::Eksblowfish::Bcrypt</a> Implementation en Perl</li>
<li><a rel="nofollow" class="external text" href="https://bcrypthashgenerator.tool-kit.dev/">bcrypt hash générateur et vérificateur outil en ligne/</a></li>
<li><a rel="nofollow" class="external text" href="https://pypi.org/project/bcrypt/">bcrypt</a> - Implémentation pour le langage Python</li></ul>
<ul id="bandeau-portail" class="bandeau-portail"><li><span class="bandeau-portail-element"><span class="bandeau-portail-icone"><span class="noviewer" typeof="mw:File"></span></span> <span class="bandeau-portail-texte">Portail de la cryptologie</span> </span></li> </ul>
<div class="navbox-container" style="clear:both;">

</div></div><!--htdig_noindex--><div><div class="zim-footer">
Cet article est issu de <a class="external text" title="Dernière modification le 2025-04-12" href="https://fr.wikipedia.org/wiki/?title=Bcrypt&amp;oldid=224737288">Wikipédia</a>. Sauf mention contraire, le texte est disponible sous <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.fr">Creative Commons Attribution-Share Alike 4.0</a>. Des conditions supplémentaires peuvent s’appliquer aux fichiers multimédias.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
<script src="./_webp_/webpHandler.js"></script>

</body></html>